import cv2

# 视频读取(本地运行)
vc = cv2.VideoCapture('f21010310俞佳文.mp4')

# 检查是否打开正确
if not vc.isOpened():
    print("Error opening video stream or file")
    exit()

while True:
    ret, frame = vc.read()
    if not ret:
        break

        # 显示视频帧
    cv2.imshow('result', frame)

    # 如果按下 'ESC' 键，则退出循环
    if cv2.waitKey(10) & 0xFF == 27:
        break

    # 释放视频对象
vc.release()
# 销毁所有窗口
cv2.destroyAllWindows()